<?php
/* 
 * 首页
 */
include_once dirname(__FILE__).'/controller.php';
class Control_index extends Controller {
     var $islogin = 1;
    public function init() {
        $this->page = $this->getNum('page') ? $this->getNum('page') : 1;
        $this->p_size = 20;
    }
    public function index() {           //用户post列表页
        $uid = getCookies('__d');
        $m_mpost = new Model_mpost();
        $total = $m_mpost->getMyPostTotal($uid);
        if($total>0) {
            $page = new Tools_page($total, $this->p_size, $this->page, array());
            $start = $page->getStart();
            $list = $m_mpost->getMyPost($uid,$start,$this->p_size);
        }
        $this->view['title'] = '首页';
        $this->view['list'] = $list;
        $this->view['pagehtml'] = $page->getPage();
        $this->render('index/index.html');
    }
}
?>